package org.ecbox.sdk.request;

import java.util.HashMap;
import java.util.Map;

import org.ecbox.sdk.ApiRuleException;
import org.ecbox.sdk.EopHashMap;
import org.ecbox.sdk.EopUploadRequest;
import org.ecbox.sdk.internal.util.FileItem;
import org.ecbox.sdk.response.ImgUploadResponse;

/**
 * 商品图片上传请求
 * 
 * File: ProductImgUploadRequest.java<br/>
 * Description: <br/>
 * 
 * Copyright: Copyright (c) 2014 ecbox.com<br/>
 * Company: ECBOX,Inc.<br/>
 * 
 * @author chenxiaochun
 * @date 2014年11月26日
 * @version 1.0
 */
public class ImgUploadRequest extends EopUploadRequest<ImgUploadResponse> {

  private Long companyId;
  private Long userId;
  private FileItem image;

  @Override
  public String getApiMethodName() {
    return "ecbox.img.upload";
  }

  @Override
  public Class<ImgUploadResponse> getResponseClass() {
    return ImgUploadResponse.class;
  }

  @Override
  public void check() throws ApiRuleException {
  }

  @Override
  public EopHashMap getTextParams() {
    EopHashMap params = new EopHashMap();
    params.put("companyId", companyId);
    params.put("userId", userId);
    return params;
  }

  @Override
  public Map<String, FileItem> getFileParams() {
    Map<String, FileItem> params = new HashMap<String, FileItem>();
    params.put("image", this.image);
    return params;
  }

  public Long getCompanyId() {
    return companyId;
  }

  public void setCompanyId(Long companyId) {
    this.companyId = companyId;
  }

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  public FileItem getImage() {
    return image;
  }

  public void setImage(FileItem image) {
    this.image = image;
  }

}
